package com.briup.mt.web.controller;

import com.briup.mt.bean.BaseLog;
import com.briup.mt.service.IBaseLogService;
import com.briup.mt.utils.Message;
import com.briup.mt.utils.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;
@RestController
@RequestMapping("BaseLog")
public class BaseLogController {
    @Autowired
    private IBaseLogService baseLogService;
    @GetMapping("query")
    public Message query(Long id){
        List<BaseLog> list=baseLogService.query(id);
        return MessageUtil.success(list);
    }
    @PostMapping("saveOrUpdate")
    public Message saveOrUpdate(BaseLog Log){
        baseLogService.saveOrUpdate(Log);
        return MessageUtil.success("操作成功");
    }
    @DeleteMapping("deleteById")
    public Message deleteById(@RequestParam @NotNull long id){
        baseLogService.deleteById(id);
        return MessageUtil.success("删除成功");
    }

}
